<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">       
		<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
		<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
		<title>Listado Facturas</title>
    </head>
    <body class="container">
        <%@include file="../../opciones.jsp"%>
        <h1>Listado de Facturas</h1>
        <table class="table table-condensed table-bordered table-hover">
                    <tr>
                        <th>FOLIO</th>
                        <th>RUT</th>
                        <th>EMPRESA</th>
                        <th>TOTAL</th>
                        <th>FECHA</th>
                        <th>CODIGO FAC.</th>
                        <th>ESTADO</th>
                        <th>VER DETALLE</th>
                        <th>ELIMINAR</th>
                    </tr>
                    <c:forEach var="fila" items="${lista}">
                        <tbody>
                        <tr>
                            <td><c:out value="${fila.corrFactura}" /></td>
                            <td><c:out value="${fila.codProveedor}" /></td>
                            <td><c:out value="${fila.nombre}" /></td>
                            <td><c:out value="${fila.total}" /></td>
                            <td><c:out value="${fila.fecha}" /></td>
                            <td><c:out value="${fila.codFactura}" /></td>
                            <c:if test="${fila.estado == true}"><td>ACTIVO</td></c:if>
                            <c:if test="${fila.estado == false}"><td>NO ACTIVO</td></c:if>
                            <td> <a id="detalle" class="btn btn-success" href="<c:url value="/MostrarDetalleFactura?CORR_FACTURA="/><c:out value="${fila.corrFactura}" />" >Ver Detalle</a></td>
                            <c:if test="${fila.estado == true}"><td> <a id="detalle" class="btn btn-danger" href="<c:url value="/AnularFactura?CORR_FACTURA="/><c:out value="${fila.corrFactura}" />" >DESHABILITAR</a></td></c:if>
                            
                        </tr>
                        </tbody>
                    </c:forEach>
                </table>
        </div>
    </body>
</html>
